//
//@File    :	13.7_brass.h
//@Time    :	2021/09/18 17:08:26
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	bank account classes
//
//要在派生类中重新定义基类的方法,通常应将基类方法声明为虚
//为基类声明一个虚析构函数是一种惯例
#ifndef BRASS_H_
#define BRASS_H_
#include <string>
//Brass Account Class
class Brass
{
private:
    std::string fullName;//客户姓名
    long acctNum;//账号
    double balance;//当前结余
public:
    Brass(const std::string & s="Nullbody",long an=-1,double bal=0.0);//构造函数
    void Deposit(double amt);//存款
    virtual void Withdraw(double amt);//取款
    double Balance() const;//显示结算
    virtual void ViewAcct() const;//显示账户信息
    virtual ~Brass(){};//虚析构函数
};
//Brass Plus Account Class
//Brass的派生类BrassPlus
class BrassPlus:public Brass
{
private:
    double maxLoan;//最大贷款(透支上限)
    double rate;//透支贷款利率
    double owesBank;//当前透支总额
public:
    BrassPlus(const std::string & s="Nullbody",long an=-1,double bal=0.0,double ml=500,double r=0.11125);
    BrassPlus(const Brass & ba,double ml=500,double r=0.11125);
    //用virtual关键字在派生类中指出那些函数时虚函数
    virtual void ViewAcct() const;
    virtual void Withdraw(double amt);
    //重置透支上限,利率,透支总额
    void ResetMax(double m){maxLoan=m;};
    void ResetRate(double r){rate=r;};
    void ResetOwes(){owesBank=0;};
};
#endif	// BRASS_H_